/*
 * @(#)cn.design.pattern.iterator 2020/4/24/0024
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.iterator;

import java.util.Iterator;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/24/0024
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class ComputerCollege implements College {
	Department[] departments;
	int numOfDepartment = 0;

	public ComputerCollege() {
		departments = new Department[5];
		addDepartment("java专业","java专业");
		addDepartment("python专业","python专业");
		addDepartment("c++专业","c++专业");
	}

	@Override
	public String getName() {
		return "计算机学院";
	}

	@Override
	public void addDepartment(String name, String desc) {
		Department department = new Department(name, desc);
		departments[numOfDepartment] = department;
		numOfDepartment++;
	}

	@Override
	public Iterator createIterator() {
		return new ComputeCollegeIterator(departments);
	}
}
